<template>
	<view>
		<view class="modal" v-if="showModal">
			<view class="modal-content">
				<scroll-view scroll-y="true">
					<img src="http://8.146.208.139:3000/img_test/b1.jpg" alt="" class="head" />
					<h2 class="title">{{ modalTitle }}</h2>
					<view class="time">
						{{time}}
					</view>
					<view class="location">
						校内
					</view>
					<view class="content">{{ modalContent }}</view>
					<view class="btn">
						<button class="cu-btn lines-red round sm shadow">收藏</button>
						<button class="cu-btn lines-blue round sm shadow">应邀</button>
						<button class="cu-btn lines-green round sm shadow">联系</button>
					</view>
				</scroll-view>
				<view class="modal-buttons">
					<button @click="handleConfirm">详情</button>
					<button @click="handleCancel">取消</button>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				showModal: true,
				modalTitle: '找篮球搭子！',
				modalContent: '每周六下午松山湖校区，一起打球，技术不太好，想要一起训练',
				time:'2023/12/23/14:00'
			};
		},
		methods: {
			//确认
			handleConfirm() {
				// 处理模态框确认按钮点击事件
				// 可以在这个方法中执行你需要的操作
				this.showModal = false; // 关闭模态框
			},
			//取消
			handleCancel() {
				// 处理模态框取消按钮点击事件
				// 可以在这个方法中执行你需要的操作
				this.showModal = false; // 关闭模态框
			}
		}
	};
</script>

<style scoped lang="scss">
	/* 遮罩层 */
	.modal {
		z-index: 10;
		position: fixed;
		top: 0;
		left: 0;
		width: 100%;
		height: 100%;
		background-color: rgba(0, 0, 0, 0.5);
		display: flex;
		justify-content: center;
		align-items: center;
	}

	/* 窗口 */
	.modal-content {
		background-color: white;
		width: 600rpx;
		height: 800rpx;
		border-radius: 8rpx;
		position: relative;
		padding: 20rpx;
		text-align: center;
		.head{
			width: 120rpx;
			height: 120rpx;
			border-radius: 75%;
		}
		.title {
			font-size: 30rpx;
			font-weight: bold;
			font-family: 'Arial';
			margin-bottom: 20rpx;
		}
		.content {
			font-size: 30rpx;
			color: #333;
			margin-bottom: 40rpx;
		}
		.time{
			font-size: 30rpx;
			color:red;
		}
		.location{
			font-size: 30rpx;
			color:red;
		}
		.action-button {
			width: 240rpx;
			height: 60rpx;
			margin-right: 20rpx;
			border: none;
			border-radius: 8rpx;
			font-size: 24rpx;
			cursor: pointer;

			&:last-child {
				margin-right: 0;
			}
		}
	}

	/* 按钮 */
	.modal-buttons {
		width: 100%;
		display: flex;
		justify-content: space-evenly;
		bottom: 0;
		left: 0;
		position: absolute;
		margin: 0;
	}

	.modal-buttons button {
		width: 200rpx;
		height: 60rpx;
		border: none;
		border-radius: 0;
		font-size: 24rpx;
		cursor: pointer;
	}

	.modal-buttons button:first-child {
		background-color: #74bfe7;
		color: #fff;
	}

	.modal-buttons button:last-child {
		border: 2rpx solid #74bfe7;
		background-color: #fff;
		color: #74bfe7;
	}
	
	.btn{
		width: 100%;
		display: flex;
		justify-content: space-evenly;
	}
</style>